list = [1,"hello world",3.14,True]
list.append(666) # 添加元素
print(list)

list.extend([8,9,10]) # 批量添加元素
print(list)

list.insert(2,"second") # 指定索引位置插入元素
print(list)

list.pop(2) # 根据索引删除元素
print(list)

list.remove(3.14) # 删除指定元素
print(list)

print(" ")

# 计算若干个人的平均年龄
age = [10,20,30,40,23,45]
total = 0
for i in age:
    total += i
print(total / len(age))

# 简化写法
print(sum(age) / len(age))





